package com.wynet.shopsapp.controller;


import com.wynet.shopsapp.service.intf.OssLogService;
import com.wynet.shopsapp.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;


@RestController
@RequestMapping("/api/oss/")
@CrossOrigin
@Api(tags = "实现文件上传的相关操作")
public class OssLogController {
    @Resource
    private OssLogService service;

    @ApiOperation(value = "实现图片上传",notes = "实现图片上传")
    @PostMapping("uploadimg.do")
    public R uploadImg(@RequestPart MultipartFile file){
        return service.uploadImg(file);
    }

    @ApiOperation(value = "查询所有的上传记录",notes = "查询所有的上传记录")
    @GetMapping("all.do")
    public R all(){
        return service.all();
    }

}
